<?php

/**
 * Class Core_Validator_Array
 * @package Core
 */
class Core_Validator_Array implements Core_Validator_Interface {
    public $validator;

    public function __construct(Core_Validator_Interface $validator) {
        $this->validator = $validator;
    }

    public function isValid($data) {
        $isValid = true;
        foreach ((array)$data as $d) {
            $isValid = $isValid && $this->validator->isValid($d);
        }
        return $isValid;
    }
}